<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 400px;
            height: 400px;
            background-color: red;
        }
    </style>
</head>

<body>
    <div class="box">

    </div>
    <script>
        var oBox = document.getElementsByClassName('box')[0],
            lastDate = 0;

        // 我们不能控制move时间移动的频率，但是可以控制核心代码执行频率
        oBox.onmousemove = function () {
            var nowDate = Date.now();
            if (nowDate - lastDate < 100) {
                return;
            }
            
            lastDate = nowDate;
            console.log('move');
        }
    </script>
</body>

</html>